Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Upgrade EVM pallet to FRAMEv2 #648

Merged
merged 5 commits into from
Jun 7, 2021
Merged

Upgrade EVM pallet to FRAMEv2 #648

merged 5 commits into from
Jun 7, 2021

Conversation

boundless-forest
Copy link
Member

@boundless-forest boundless-forest commented May 26, 2021

The old version metadata:

$ subsee -p EVM > evm_old.json

{"name":"EVM","storage":{"prefix":"EVM","entries":[{"name":"AccountCodes","modifier":"Default","ty":{"Map":{"hasher":"Blake2_128Concat","key":"H160","value":"Vec<u8>","unused":false}},"default":[0],"documentation":[]},{"name":"AccountStorages","modifier":"Default","ty":{"DoubleMap":{"hasher":"Blake2_128Concat","key1":"H160","key2":"H256","value":"H256","key2_hasher":"Blake2_128Concat"}},"default":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"documentation":[]}]},"calls":[{"name":"call","arguments":[{"name":"source","ty":"H160"},{"name":"target","ty":"H160"},{"name":"input","ty":"Vec<u8>"},{"name":"value","ty":"U256"},{"name":"gas_limit","ty":"u64"},{"name":"gas_price","ty":"U256"},{"name":"nonce","ty":"Option<U256>"}],"documentation":[" Issue an EVM call operation. This is similar to a message call transaction in Ethereum."]},{"name":"create","arguments":[{"name":"source","ty":"H160"},{"name":"init","ty":"Vec<u8>"},{"name":"value","ty":"U256"},{"name":"gas_limit","ty":"u64"},{"name":"gas_price","ty":"U256"},{"name":"nonce","ty":"Option<U256>"}],"documentation":[" Issue an EVM create operation. This is similar to a contract creation transaction in"," Ethereum."]},{"name":"create2","arguments":[{"name":"source","ty":"H160"},{"name":"init","ty":"Vec<u8>"},{"name":"salt","ty":"H256"},{"name":"value","ty":"U256"},{"name":"gas_limit","ty":"u64"},{"name":"gas_price","ty":"U256"},{"name":"nonce","ty":"Option<U256>"}],"documentation":[" Issue an EVM create2 operation."]}],"event":[{"name":"Log","arguments":["Log"],"documentation":[" Ethereum events from contracts."]},{"name":"Created","arguments":["H160"],"documentation":[" A contract has been created at given \\[address\\]."]},{"name":"CreatedFailed","arguments":["H160"],"documentation":[" A \\[contract\\] was attempted to be created, but the execution failed."]},{"name":"Executed","arguments":["H160"],"documentation":[" A \\[contract\\] has been executed successfully with states applied."]},{"name":"ExecutedFailed","arguments":["H160"],"documentation":[" A \\[contract\\] has been executed with errors. States are reverted with only gas fees applied."]},{"name":"BalanceDeposit","arguments":["AccountId","H160","U256"],"documentation":[" A deposit has been made at a given address. \\[sender, address, value\\]"]},{"name":"BalanceWithdraw","arguments":["AccountId","H160","U256"],"documentation":[" A withdrawal has been made from a given address. \\[sender, address, value\\]"]}],"constants":[],"errors":[{"name":"BalanceLow","documentation":[" Not enough balance to perform action"]},{"name":"FeeOverflow","documentation":[" Calculating total fee overflowed"]},{"name":"PaymentOverflow","documentation":[" Calculating total payment overflowed"]},{"name":"WithdrawFailed","documentation":[" Withdraw fee failed"]},{"name":"GasPriceTooLow","documentation":[" Gas price is too low."]},{"name":"InvalidNonce","documentation":[" Nonce is invalid"]}],"index":40}

the new version metadata after upgrade:

$ subsee -p EVM > evm_new.json

{"name":"EVM","storage":{"prefix":"EVM","entries":[{"name":"AccountCodes","modifier":"Default","ty":{"Map":{"hasher":"Blake2_128Concat","key":"H160","value":"Vec<u8>","unused":false}},"default":[0],"documentation":[]},{"name":"AccountStorages","modifier":"Default","ty":{"DoubleMap":{"hasher":"Blake2_128Concat","key1":"H160","key2":"H256","value":"H256","key2_hasher":"Blake2_128Concat"}},"default":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"documentation":[]}]},"calls":[{"name":"call","arguments":[{"name":"source","ty":"H160"},{"name":"target","ty":"H160"},{"name":"input","ty":"Vec<u8>"},{"name":"value","ty":"U256"},{"name":"gas_limit","ty":"u64"},{"name":"gas_price","ty":"U256"},{"name":"nonce","ty":"Option<U256>"}],"documentation":[" Issue an EVM call operation. This is similar to a message call transaction in Ethereum."]},{"name":"create","arguments":[{"name":"source","ty":"H160"},{"name":"init","ty":"Vec<u8>"},{"name":"value","ty":"U256"},{"name":"gas_limit","ty":"u64"},{"name":"gas_price","ty":"U256"},{"name":"nonce","ty":"Option<U256>"}],"documentation":[" Issue an EVM create operation. This is similar to a contract creation transaction in"," Ethereum."]},{"name":"create2","arguments":[{"name":"source","ty":"H160"},{"name":"init","ty":"Vec<u8>"},{"name":"salt","ty":"H256"},{"name":"value","ty":"U256"},{"name":"gas_limit","ty":"u64"},{"name":"gas_price","ty":"U256"},{"name":"nonce","ty":"Option<U256>"}],"documentation":[" Issue an EVM create2 operation."]}],"event":[{"name":"Log","arguments":["Log"],"documentation":[" Ethereum events from contracts."]},{"name":"Created","arguments":["H160"],"documentation":[" A contract has been created at given \\[address\\]."]},{"name":"CreatedFailed","arguments":["H160"],"documentation":[" A \\[contract\\] was attempted to be created, but the execution failed."]},{"name":"Executed","arguments":["H160"],"documentation":[" A \\[contract\\] has been executed successfully with states applied."]},{"name":"ExecutedFailed","arguments":["H160"],"documentation":[" A \\[contract\\] has been executed with errors. States are reverted with only gas fees applied."]},{"name":"BalanceDeposit","arguments":["AccountId","H160","U256"],"documentation":[" A deposit has been made at a given address. \\[sender, address, value\\]"]},{"name":"BalanceWithdraw","arguments":["AccountId","H160","U256"],"documentation":[" A withdrawal has been made from a given address. \\[sender, address, value\\]"]}],"constants":[],"errors":[{"name":"BalanceLow","documentation":[" Not enough balance to perform action"]},{"name":"FeeOverflow","documentation":[" Calculating total fee overflowed"]},{"name":"PaymentOverflow","documentation":[" Calculating total payment overflowed"]},{"name":"WithdrawFailed","documentation":[" Withdraw fee failed"]},{"name":"GasPriceTooLow","documentation":[" Gas price is too low."]},{"name":"InvalidNonce","documentation":[" Nonce is invalid"]}],"index":40}

@boundless-forest boundless-forest marked this pull request as ready for review May 26, 2021 08:05
@AurevoirXavier AurevoirXavier added the BK-Storage [Break] This changes storage; next release should be major. label May 26, 2021
@AurevoirXavier
Copy link
Member

Is there a companion PR from upstream?

@boundless-forest
Copy link
Member Author

Is there a companion PR from upstream?

Not exactly. There is a merged pr in upstream polkadot-evm/frontier#380. Since there are some subtle differences between darwinia-evm and upstream evm pallet, so I upgraded this pallet by myself following guidelines.

Copy link
Contributor

@hackfisher hackfisher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runtimes are using the same pallet prefix "EVM".

LGTM

@hackfisher
Copy link
Contributor

@AurevoirXavier Please help review this pull request

@hackfisher hackfisher merged commit 5995741 into master Jun 7, 2021
@hackfisher hackfisher deleted the darwinia-evm-new-style branch June 7, 2021 09:39
@hackfisher hackfisher mentioned this pull request Jun 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
BK-Storage [Break] This changes storage; next release should be major.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants